package com.cnsoft.persistent.player.U102030Comment;

import javax.annotation.Resource;

import org.cnsoft.framework.beans.common.RESTResultBean;
import org.cnsoft.framework.db.page.PageModel;
import org.cnsoft.framework.support.MyControllerSupport;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员评论表接口
 */
@CrossOrigin
@RestController
@RequestMapping(value = "/api/1.0/base/u102030comment", method = { RequestMethod.POST })
public class U102030CommentApiController extends MyControllerSupport { // MyTokenCommonSupport
	@Resource
	protected U102030CommentBusinesslogic bizU102030Comment;

	// private MyModelAndViewSupport model =
	// super.getModelAndView("U102030_comment");

	// 一览（分页查询）
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	public RESTResultBean<U102030CommentDBO> doList(U102030CommentDBO param, PageModel<U102030CommentDBO> pageModel) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 设定查询参数
		pageModel.setFormParamBean(param);
		// 开启记录数统计
		// pageModel.setResultCountFlag(true);
		// 排序模式
		// pageModel.setOrderbyCreateTimeDESC();
		// 分页查询
		return bizU102030Comment.doList(pageModel);
	}

	// 信息详情
	@RequestMapping(value = "/info", method = RequestMethod.POST)
	public RESTResultBean<U102030CommentDBO> doInfo(U102030CommentDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 数据查询
		return bizU102030Comment.doInfo(param);
	}

	// 信息插入
	@RequestMapping(value = "/append", method = RequestMethod.POST)
	public RESTResultBean<String> doAppend(U102030CommentDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		return bizU102030Comment.doAppend(param);
	}

	// 信息编辑
	@RequestMapping(value = "/modify", method = RequestMethod.POST)
	public RESTResultBean<String> doModify(U102030CommentDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		return bizU102030Comment.doModify(param);
	}

	// 信息删除
	@RequestMapping(value = "/discard", method = RequestMethod.POST)
	public RESTResultBean<String> doDiscard(U102030CommentDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		return bizU102030Comment.doDiscard(param);
	}
}
